<!DOCTYPE html>
<html>
 <head> 
  <title>初探Laravel5--闫海的个人博客-芒果小叨</title> 
  <!-- meta tags start --> 
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  <meta name="Keywords" content="个人博客,闫海个人博客,Laravel,Laravel5,安装Laravel,com" /> 
  <meta name="Description" content="第一课，简单介绍composer和Laravel5的安装。" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> 
  <!-- meta tags end -->
  <!-- favorite icon starts -->
  <link rel="shortcut icon" href="/Public/Index/mobile/images/common/favicon.ico" type="image/x-icon" />
  <!-- favorite icon ends -->
  <!-- CSS files start -->
  <link href="/Public/Index/mobile/css/framework.css" rel="stylesheet" type="text/css" media="all" />
  <link href="/Public/Index/mobile/css/colorbox.css" rel="stylesheet" type="text/css" media="all" />
  <link href="/Public/Index/mobile/css/responsive.css" rel="stylesheet" type="text/css" media="screen" />
  <link href="/Public/Index/mobile/css/hidpi.css" rel="stylesheet" type="text/css" media="screen" />
  <link href="/Public/Index/mobile/css/skin.css" rel="stylesheet" type="text/css" media="all" />
  <link href="/Public/Index/mobile/css/custom.css" rel="stylesheet" type="text/css" media="all" />
  <link href="/Public/Index/mobile/css/elements.css" rel="stylesheet" type="text/css" media="all" />
  <link href="/Public/Index/mobile/css/style.css" rel="stylesheet" type="text/css" media="all" />
  
  <!-- CSS files end -->
  <!-- JavaScript files start --> 
  <script type="text/javascript" src="/Public/Index/mobile/grayscale.js"></script>
  <script type="text/javascript" src="/Public/Index/mobile/js/jquery.min.js"></script>
  <script type="text/javascript" src="/Public/Index/mobile/js/effects.jquery-ui.min.js"></script>
  <script type="text/javascript" src="/Public/Index/mobile/js/jquery.nivo-slider.min.js"></script>
  <script type="text/javascript" src="/Public/Index/mobile/js/custom.js"></script>
  <script type="text/javascript" src="/Public/Index/mobile/js/jquery.colorbox.min.js"></script>
  
  <!-- JavaScript files end -->
 </head>
 <body>
  <!-- website wrapper starts -->
  <div class="websiteWrapper"> 
   <!-- main menu wrapper starts --> 
   <div class="mainMenuOuterWrapper"> 
    <a href="#" class="mainMenuCloseButton"></a> 
    <ul class="mainMenuWrapper"> 
     <li class="currentPage"><a href='/mobile.php/index.html' title='首页'>首页</a></li>
      <li><a href='/mobile.php/list/2.html' title='关于我'>关于我<span> </span></a></li><li><a href='/mobile.php/list/3.html' title='时光轴'>时光轴<span> </span></a></li><li><a href='/mobile.php/list/1.html' title='品味人生'>品味人生<span> </span></a></li><li><a href='/mobile.php/list/5.html' title='技术分享'>技术分享<span> </span></a></li>     <li><a href='/mobile.php/index/article/message.html'  title='给我留言'>给我留言</a></li>
    </ul> 
   </div> 
   <!-- main menu wrapper ends --> 

<script type="text/javascript">
  var url = '/mobile.php/article';
  $(function(){
    var id = '45';
    $.post(url+'/addClick',{'id':id},function(data){
        $("#pclick").html('点击数：' + data);
    });
  })
</script>
   <!-- header wrapper starts --> 
   <div class="headerOuterWrapper pageHeaderWrapper"> 
    <div class="headerWrapper"> 
     <a class="mainLogo" href="/mobile.php/index.html"><img src="/Public/Index/mobile/images/mainLogo.png" alt="" /></a> 
     <a href="#" class="mainMenuButton"></a>
    </div>
    <!-- page title starts --> 
    <h5 class="pageTitle">当前位置：
	<a href="/mobile.php/index.html">首页</a>&nbsp;&gt;&nbsp;
	<a href="/mobile.php/list/5.html">技术分享</a>
	&nbsp;&gt;&nbsp;<a href="/mobile.php/list/17.html">Laravel教程</a>
	</h5>    <!-- page title ends --> 
   </div>
   <!-- header wrapper ends --> 
   <!-- page wrapper starts --> 
   <div class="pageWrapper singlePostPageWrapper"> 
    <!-- post content wrapper starts --> 
    <div class="singlePostContentWrapper">
    <h3 class="pageTitle" style="background:#F0F0F0;color:#333;text-align:center;">初探Laravel5</h3> 
     <div class="pageSpacer"></div> 
     <div class="pageSpacer"></div> 
     <div style="word-break: break-all;" class="phoneContent"><p><span style="font-size: 24px;"><strong>composer</strong></span><br/>安装composer是必须的，mac的话，命令行进入项目目录，执行：<br/></p><pre class="brush:bash;toolbar:false">curl&nbsp;-sS&nbsp;https://getcomposer.org/installer&nbsp;|&nbsp;php</pre><p>下载下来是个打包文件composer.phar<br/>如果你是windows，需要下载&nbsp;<a title="https://getcomposer.org/Composer-Setup.exe" target="_blank" href="https://getcomposer.org/Composer-Setup.exe">https://getcomposer.org/Composer-Setup.exe</a> 来进行管理，值得注意的是，如果安装不成功，一般会提示要开启php扩展openssl，如果你用的wamp集成环境，切记在wamp面板中修改php.ini是没用的，需要修改wamp/bin/php/你的php版本/php.ini，去掉extension=php_openssl.dll前面的分号，并重启server。<br/><strong><span style="font-size: 24px;">安装Laravel</span></strong><br/></p><p>下载<a title="最新版本框架" target="_blank" href="https://github.com/laravel/laravel/archive/master.zip">最新版本框架</a>，解压到项目文件夹下，然后在项目目录下运行：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;composer.phar&nbsp;install</pre><p>来安装所有的框架依赖包。 但是这样做的话过一会儿你会疯掉，原因很简单，速度慢到死。国内有一个composer的中国镜像，但是不推荐使用，非常不稳定。我使用的是<a title="Composer Proxy JP" target="_blank" href="http://composer-proxy.jp/">http://composer-proxy.jp/</a><br/></p><p>使用方法：<br/>在项目根目录composer.json中加入<br/></p><pre class="brush:js;toolbar:false">&quot;repositories&quot;:&nbsp;[
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&quot;packagist&quot;:&nbsp;false&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;type&quot;:&nbsp;&quot;composer&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;url&quot;:&nbsp;&quot;http://composer-proxy.jp/proxy/packagist&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;]</pre><p>来提高使用composer下载的速度。配置好后再执行：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;composer.phar&nbsp;install</pre><p>来安装框架依赖包。<br/>安装完成后运行框架，可以通过apache访问，开启apache，访问项目目录下public，默认显示欢迎界面。。。（可以自行配置apache把public作为根目录）<br/>或者用artisan，命令行中输入：<br/></p><pre class="brush:bash;toolbar:false">php&nbsp;artisan&nbsp;start</pre><p>然后通过localhost：8000访问</p><p>如果一切顺利，你会看到这个界面：</p><p><img alt="psb.jpg" src="/Uploads/ueditor/image/20150528/556663a5b8d4e.jpg" title="556663a5b8d4e.jpg"/></p><p>如果你并没有看到这个界面，而是一片空白，好吧，应该是你目录权限的问题（mac），由于是本地测试，你完全可以在项目返回你项目得上一层目赋予777权限：</p><pre class="brush:bash;toolbar:false">sudo&nbsp;chmod&nbsp;-R&nbsp;0777&nbsp;项目名称</pre><p>OK，开始Laravel5学习之旅吧。</p></div>
     <div class="textBreak"></div> 
    </div> 
    <!-- post content wrapper ends --> 
    <!-- post info starts --> 
    <div class="singlePostInfoWrapper">
     <span class="singleIconWrapper singleIconText iconCalendarDark postInfo postDate">2015-05-28</span>
     <a class="singleIconWrapper singleIconText iconEditDark postInfo postAuthor postInfoNoMargin">小叨</a>&nbsp;&nbsp;
     <span class="singleIconWrapper singleIconText iconArrowRightDark" id="pclick">点击数：269</span>
    </div> 
    <!-- post info ends --> 
    <!-- post links wrapper starts --> 
    <div class="singlePostContentWrapper"> 
     <p>上一篇：已经是第一篇文章了</p>
     <p>下一篇：<a href="/mobile.php/article/46.html">laravel5.1安装</a></p>
    </div> 
    <!-- post links wrapper ends --> 
    <!-- comments section wrapper starts --> 
    <div class="commentsSectionWrapper"> 
     <h4 class="commentsTitle">相关阅读：</h4> 
     <!-- comments wrapper starts --> 
     <!-- accordion item wrapper starts --> 
        <div class="accordionContent"> 
         <p><a href="/mobile.php/article/48.html" title="【Laravel5教程】mac+apache+mysql配置多站点(一)">【Laravel5教程】mac+apache+mysql配置多站点(一)</a></p><p><a href="/mobile.php/article/47.html" title="Laravel5.1配置">Laravel5.1配置</a></p><p><a href="/mobile.php/article/46.html" title="laravel5.1安装">laravel5.1安装</a></p><p><a href="/mobile.php/article/45.html" title="初探Laravel5">初探Laravel5</a></p>        </div> 
     <!-- accordion item wrapper ends -->
     <!-- coments wrapper ends --> 
    </div> 
    <!-- comments section wrapper ends --> 
   </div> 
   <!-- page wrapper ends --> 
   <!-- footer wrapper starts --> 
   <div class="footerWrapper"> 
    <!-- copyright wrapper starts --> 
    <div class="copyrightWrapper"> 
     <!-- copyright starts --> 
     <span class="copyright"><a href="http://www.miitbeian.gov.cn/">鲁ICP备15004472号-1</a></span> 
     <!-- copyright ends --> 
     <!-- back to top button starts --> 
     <a href="" class="backToTopButton"></a> 
     <!-- back to top button ends --> 
    </div> 
    <!-- copyright wrapper ends --> 
   </div> 
   <!-- footer wrapper ends --> 
  </div>
  <!-- website wrapper ends -->
 </body>
</html>